package com.web.ThirdService.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NormalMessageConfigration {
    @Bean
    public DirectExchange normalMessageExchange() {
        return new DirectExchange("normal.exchage");
    }

    @Bean
    public Queue normalMessageQueue() {
        return QueueBuilder.durable("normal.queue").deadLetterExchange("dlx.exchange").build();
    }

    @Bean
    public Binding normalMessageBinding(Queue normalMessageQueue, DirectExchange normalMessageExchange) {
        return BindingBuilder.bind(normalMessageQueue).to(normalMessageExchange).with("dlx");
    }
}
